/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package mywebapp.webpage.impl;

import java.util.Collection;

import mywebapp.dao.Champ;

import mywebapp.webpage.BaliseElement;
import mywebapp.webpage.Text;
import mywebapp.webpage.WebpagePackage;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Balise Element</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link mywebapp.webpage.impl.BaliseElementImpl#getChamp <em>Champ</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public abstract class BaliseElementImpl extends BaliseImpl implements BaliseElement {
	/**
	 * The cached value of the '{@link #getChamp() <em>Champ</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getChamp()
	 * @generated
	 * @ordered
	 */
	protected Champ champ;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected BaliseElementImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EClass eStaticClass() {
		return WebpagePackage.Literals.BALISE_ELEMENT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Champ getChamp() {
		if (champ != null && champ.eIsProxy()) {
			InternalEObject oldChamp = (InternalEObject)champ;
			champ = (Champ)eResolveProxy(oldChamp);
			if (champ != oldChamp) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WebpagePackage.BALISE_ELEMENT__CHAMP, oldChamp, champ));
			}
		}
		return champ;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Champ basicGetChamp() {
		return champ;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setChamp(Champ newChamp) {
		Champ oldChamp = champ;
		champ = newChamp;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WebpagePackage.BALISE_ELEMENT__CHAMP, oldChamp, champ));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case WebpagePackage.BALISE_ELEMENT__CHAMP:
				if (resolve) return getChamp();
				return basicGetChamp();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case WebpagePackage.BALISE_ELEMENT__CHAMP:
				setChamp((Champ)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eUnset(int featureID) {
		switch (featureID) {
			case WebpagePackage.BALISE_ELEMENT__CHAMP:
				setChamp((Champ)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case WebpagePackage.BALISE_ELEMENT__CHAMP:
				return champ != null;
		}
		return super.eIsSet(featureID);
	}

} //BaliseElementImpl
